import { http } from '@/tool/utils'
import { iPb } from '@/protobuf/interface'

export function ListAdmin(data: iPb.Admin.IListAdminRequest):Promise<iPb.Admin.IListAdminResponse> {
    return http.post("ListAdmin",iPb.Admin.ListAdminRequest.toObject(iPb.Admin.ListAdminRequest.create(data)))
}

export function CreateAdmin(data: iPb.IDbAdmin):Promise<iPb.Admin.ICreateAdminResponse> {
    return http.post("CreateAdmin",iPb.DbAdmin.toObject(iPb.DbAdmin.create(data)))
}

export function UpdateAdmin(data: iPb.IDbAdmin):Promise<iPb.Admin.IUpdateAdminResponse> {
    return http.post("UpdateAdmin",iPb.DbAdmin.toObject(iPb.DbAdmin.create(data)))
}

export function ReadAdmin(formData: iPb.Admin.IReadAdminRequest):Promise<iPb.IDbAdmin> {
    return http.post("ReadAdmin",iPb.Admin.ReadAdminRequest.create(formData))
}

export function DeleteAdmin(formData: iPb.Admin.IDeleteAdminRequest):Promise<iPb.Admin.IDeleteAdminResponse> {
    return http.post("DeleteAdmin",iPb.Admin.DeleteAdminRequest.create(formData))
}